package com.cloud.xtools.common.validator.annotation;

import com.cloud.xtools.common.validator.EntityExistValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * @author Daixinguo
 */
@Documented
@Target({ ElementType.FIELD, ElementType.PARAMETER })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = EntityExistValidator.class)
public @interface EntityExist {
    Class<?> entity();
    String field() default "id";
    String message() default "Not Found!";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
